<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class template basic_formatter</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Log v2">
<link rel="up" href="../../expressions.html#header.boost.log.expressions.formatter_hpp" title="Header &lt;boost/log/expressions/formatter.hpp&gt;">
<link rel="prev" href="swap_idp33905472.html" title="Function swap">
<link rel="next" href="swap_idp33942816.html" title="Function template swap">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="swap_idp33905472.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../expressions.html#header.boost.log.expressions.formatter_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="swap_idp33942816.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.log.basic_formatter"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template basic_formatter</span></h2>
<p>boost::log::basic_formatter</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../expressions.html#header.boost.log.expressions.formatter_hpp" title="Header &lt;boost/log/expressions/formatter.hpp&gt;">boost/log/expressions/formatter.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> CharT<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="basic_formatter.html" title="Class template basic_formatter">basic_formatter</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="keyword">void</span>                                  <a name="boost.log.basic_formatter.result_type"></a><span class="identifier">result_type</span><span class="special">;</span>  <span class="comment">// Result type. </span>
  <span class="keyword">typedef</span> <span class="identifier">CharT</span>                                 <a name="boost.log.basic_formatter.char_type"></a><span class="identifier">char_type</span><span class="special">;</span>    <span class="comment">// Character type. </span>
  <span class="keyword">typedef</span> <span class="identifier">basic_formatting_ostream</span><span class="special">&lt;</span> <span class="identifier">char_type</span> <span class="special">&gt;</span> <a name="boost.log.basic_formatter.stream_type"></a><span class="identifier">stream_type</span><span class="special">;</span>  <span class="comment">// Output stream type. </span>

  <span class="comment">// <a class="link" href="basic_formatter.html#boost.log.basic_formatterconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="basic_formatter.html#idp33925264-bb"><span class="identifier">basic_formatter</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_formatter.html#idp33926032-bb"><span class="identifier">basic_formatter</span></a><span class="special">(</span><a class="link" href="basic_formatter.html" title="Class template basic_formatter">basic_formatter</a> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_formatter.html#idp33927712-bb"><span class="identifier">basic_formatter</span></a><span class="special">(</span>this_type <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> FunT<span class="special">&gt;</span> <a class="link" href="basic_formatter.html#idp33929728-bb"><span class="identifier">basic_formatter</span></a><span class="special">(</span><span class="identifier">FunT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_formatter.html" title="Class template basic_formatter">basic_formatter</a> <span class="special">&amp;</span> <a class="link" href="basic_formatter.html#idp33932048-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span>this_type <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="basic_formatter.html" title="Class template basic_formatter">basic_formatter</a> <span class="special">&amp;</span> <a class="link" href="basic_formatter.html#idp33934640-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span>this_type <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> FunT<span class="special">&gt;</span> <a class="link" href="basic_formatter.html" title="Class template basic_formatter">basic_formatter</a> <span class="special">&amp;</span> <a class="link" href="basic_formatter.html#idp33936896-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="identifier">FunT</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_formatter.html#idp33916624-bb">public member functions</a></span>
  <span class="identifier">result_type</span> <a class="link" href="basic_formatter.html#idp33917184-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="identifier">record_view</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">stream_type</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="basic_formatter.html#idp33921264-bb"><span class="identifier">reset</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="basic_formatter.html#idp33922592-bb"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="basic_formatter.html" title="Class template basic_formatter">basic_formatter</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp125805536"></a><h2>Description</h2>
<p>Log record formatter function wrapper. </p>
<div class="refsect2">
<a name="idp125806208"></a><h3>
<a name="boost.log.basic_formatterconstruct-copy-destruct"></a><code class="computeroutput">basic_formatter</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idp33925264-bb"></a><span class="identifier">basic_formatter</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Default constructor. Creates a formatter that only outputs log message. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp33926032-bb"></a><span class="identifier">basic_formatter</span><span class="special">(</span><a class="link" href="basic_formatter.html" title="Class template basic_formatter">basic_formatter</a> <span class="keyword">const</span> <span class="special">&amp;</span> that<span class="special">)</span><span class="special">;</span></pre>
<p>Copy constructor </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp33927712-bb"></a><span class="identifier">basic_formatter</span><span class="special">(</span>this_type <span class="special">&amp;&amp;</span> that<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Move constructor. The moved-from formatter is left in an unspecified state. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> FunT<span class="special">&gt;</span> <a name="idp33929728-bb"></a><span class="identifier">basic_formatter</span><span class="special">(</span><span class="identifier">FunT</span> <span class="keyword">const</span> <span class="special">&amp;</span> fun<span class="special">)</span><span class="special">;</span></pre>
<p>Initializing constructor. Creates a formatter which will invoke the specified function object. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="basic_formatter.html" title="Class template basic_formatter">basic_formatter</a> <span class="special">&amp;</span> <a name="idp33932048-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span>this_type <span class="special">&amp;&amp;</span> that<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Move assignment. The moved-from formatter is left in an unspecified state. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="basic_formatter.html" title="Class template basic_formatter">basic_formatter</a> <span class="special">&amp;</span> <a name="idp33934640-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span>this_type <span class="keyword">const</span> <span class="special">&amp;</span> that<span class="special">)</span><span class="special">;</span></pre>
<p>Copy assignment. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> FunT<span class="special">&gt;</span> <a class="link" href="basic_formatter.html" title="Class template basic_formatter">basic_formatter</a> <span class="special">&amp;</span> <a name="idp33936896-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="identifier">FunT</span> <span class="keyword">const</span> <span class="special">&amp;</span> fun<span class="special">)</span><span class="special">;</span></pre>
<p>Initializing assignment. Sets the specified function object to the formatter. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp125858608"></a><h3>
<a name="idp33916624-bb"></a><code class="computeroutput">basic_formatter</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">result_type</span> <a name="idp33917184-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="identifier">record_view</span> <span class="keyword">const</span> <span class="special">&amp;</span> rec<span class="special">,</span> <span class="identifier">stream_type</span> <span class="special">&amp;</span> strm<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Formatting operator.</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">rec</code></span></p></td>
<td><p>A log record to format. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">strm</code></span></p></td>
<td><p>A stream to put the formatted characters to. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp33921264-bb"></a><span class="identifier">reset</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Resets the formatter to the default. The default formatter only outputs message text. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idp33922592-bb"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="basic_formatter.html" title="Class template basic_formatter">basic_formatter</a> <span class="special">&amp;</span> that<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Swaps two formatters </p>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2007-2014 Andrey Semashev<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>).
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="swap_idp33905472.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../expressions.html#header.boost.log.expressions.formatter_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="swap_idp33942816.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
